<template>
	<view class="content">
		<view class="header_color">
			<view class="header_position">
				<view class="line"></view>
				<view class="header_font">合资品牌</view>
			</view>

			<view class="banner_list">
				<view class="banner_size" v-for="item in data" @click="todeletion()">
					<image class="banner_size_image" :src="item.thumb"></image>
				</view>
			</view>
		</view>

		<view class="building">
			<view class="header_position">
				<view class="line"></view>
				<view class="header_font">楼盘套餐</view>
			</view>

			<view class="building_list" >
				<view class="building_item" v-for="item in headerdata" @click="todeletion()">
					<image class="building_item_image" :src="item.thumb"></image>
					<view class="building_item_title">{{item.name}}</view>
					<view class="building_item_space">
						<view class="building_item_size">{{item.model}}m²</view>
						<view class="building_item_price">¥{{item.price}}</view>
					</view>
					<view class="building_item_content">{{item.desc_str}}</view>
				</view>
				
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data:[],
				headerdata:[]
			}
		},
		methods: {
			todeletion(){
				uni.navigateTo({
					url:"/pages/index/deletion"
				})
			},
			show() {
				var then = this
				this.$http.post("/system/getBrandList", {}).then(res => {
					console.log(res)
					then.data = res.data.data
				})
			},
			getheaderdata(){
				var then = this
				this.$http.post("/system/getComboList", {"page": 1,"limit": 10 }).then(res => {
					console.log(res)
					then.headerdata = res.data.data.list
				})
			}
		},
		onLoad() {
			this.show(),
			this.getheaderdata()
		}
	}
</script>

<style>
	page {
		background-color: #f5f5f5;
	}

	.content {
		width: 100vw;
		height: 100vh;
		box-sizing: border-box;
	}

	.header_color {
		padding: 28rpx 0rpx;
		background-color: white;
	}

	.header_position {
		display: flex;
		align-items: center;
		padding: 0 40rpx 20rpx 40rpx;
	}

	.header_font {
		font-size: 33rpx;
		font-weight: 700;
		font-family: PingFang SC;
		color: #333333;
		margin-left: 20rpx;
	}

	.banner_list {
		overflow-x: scroll;
		display: flex;
		margin-right: 40rpx;

	}

	.banner_size {
		height: 168rpx;
		width: 280rpx;
		position: relative;
		border-radius: 8rpx;
		margin-left: 40rpx;
	}

	.banner_size_image {
		height: 100%;
		width: 280rpx;
		border-radius: 8rpx;
	}

	.banner_size_image::after {
		font-family: PingFang SC;
		background-color: rgb(0, 0, 0, 0.2);
		height: 100%;
		width: 100%;
		font-size: 24rpx;
		color: white;
		line-height: 160rpx;
		text-align: center;
		position: absolute;
		margin: auto;
	}

	.line {
		width: 8rpx;
		height: 30rpx;
		background: #3d9c36;
	}

	::-webkit-scrollbar {
		display: none;
	}

	.building {
		padding: 28rpx 0rpx;

	}

	.building_list {
		display: grid;
		grid-gap: 40rpx;
		grid-template-columns: 1fr 1fr;
		margin: 0rpx 40rpx;
		padding-bottom: 40rpx;
	}

	.building_item {
		height: 330px;
		width: 316rpx;
		background-color: white;
		border-radius: 16rpx;
	}

	.building_item_image {
		border-radius: 16rpx 16rpx 0rpx 0rpx;
		width: 316rpx;
		height: 420rpx;
	}

	.building_item_title {
		font-family: PingFang SC, PingFang SC-Medium;
		color: #333333;
		font-size: 30rpx;
		font-weight: 500;
		margin-left: 20rpx;
	}

	.building_item_size {
		font-family: PingFang SC;
		color: #666666;
		font-size: 24rpx;
		font-weight: 500;
		margin-left: 20rpx;
	}

	.building_item_price {
		font-family: PingFang SC;
		font-size: 32rpx;
		font-weight: 500;
		color: #e54040;
		margin-right: 20rpx;
	}

	.building_item_space {
		display: flex;
		justify-content: space-between;
	}

	.building_item_content {
		font-family: PingFang SC;
		font-size: 20rpx;
		color: #666666;
		position: relative;
		margin: 0rpx 20rpx 20rpx 20rpx;
	}
</style>
